import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.RandomUtils;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

public class GenProfileTags {
    public static void main(String[] args) throws IOException {

        BufferedWriter bw = new BufferedWriter(new FileWriter("data/profile/tags.csv"));
        StringBuilder sb = new StringBuilder();
        char[] chars = {'a','b','c','d','e','f','g','h','i'};

        int tagNumber = 40;
        for(int i=1;i<=10;i++){
            for(int j=1;j<=tagNumber;j++){
                sb.append(i).append(",");
                // 添加标签名
                //sb.append("t_"+j).append(":");
                if(j<tagNumber*0.5) {
                    sb.append(RandomUtils.nextInt(1, 10));
                }else if(j<tagNumber*0.9){
                    sb.append(RandomUtils.nextInt(1, 30));
                }else if(j<tagNumber*0.95){
                    sb.append(RandomStringUtils.random(2,chars));
                }else{
                    sb.append(RandomStringUtils.random(3,chars));
                }
                sb.append(",");
            }
            bw.write(sb.toString().substring(0,sb.length()-1));
            bw.newLine();
            sb.delete(0,sb.length());
        }


        bw.close();
    }
}
